package com.gollum.common.domain.redis;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 消息队列消息实体
 *
 * @author Herther
 * @createTime 2022年11月02日 23:33:00
 * @since 1.0.0
 */

@ToString
public class MqMessage<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    private String queueName;

    private String msg;

    private T data;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private Date createTime;

    public String getQueueName() {
        return queueName;
    }

    public MqMessage<T> setQueueName(String queueName) {
        this.queueName = queueName;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public MqMessage<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public MqMessage<T> setData(T data) {
        this.data = data;
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public MqMessage<T> setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public MqMessage(String queueName, String msg, T data, Date createTime) {
        this.queueName = queueName;
        this.msg = msg;
        this.data = data;
        this.createTime = createTime;
    }
    public MqMessage() {
    }
}
